projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c409bd0
)
kbuild: fixdep: Check fstat(2) return value
author
Tom Rini
<
[email protected]
>
Fri, 13 May 2016 14:54:04 +0000
(10:54 -0400)
committer
Tom Rini
<
[email protected]
>
Mon, 23 May 2016 15:50:21 +0000
(11:50 -0400)
Coverity has recently added a check that will find when we don't check
the return code from fstat(2). Copy/paste the checking logic that
print_deps() has with an appropriate re-wording of the perror() message.
[ Linux commit :
46fe94ad18aa7ce6b3dad8c035fb538942020f2b
]
Signed-off-by: Tom Rini <
[email protected]
>
Signed-off-by: Michal Marek <
[email protected]
>
scripts/basic/fixdep.c
patch
|
blob
|
history
diff --git
a/scripts/basic/fixdep.c
b/scripts/basic/fixdep.c
index e8e8c7756deb09e00ec7cb48e3dd0ad628e3c6cc..9bd0de2490748730e750dbf8797a3ae19c431c95 100644
(file)
--- a/
scripts/basic/fixdep.c
+++ b/
scripts/basic/fixdep.c
@@
-296,7
+296,11
@@
static void do_config_file(const char *filename)
perror(filename);
exit(2);
}
- fstat(fd, &st);
+ if (fstat(fd, &st) < 0) {
+ fprintf(stderr, "fixdep: error fstat'ing config file: ");
+ perror(filename);
+ exit(2);
+ }
if (st.st_size == 0) {
close(fd);
return;